package com.pet.server.ext.action.timeline;

import java.util.ArrayList;
import java.util.List;

import com.pet.server.ext.ActionBase;
import com.pet.server.ext.ApiError;
import com.pet.server.ext.BeanToJson;
import com.pet.server.ext.Result;
import com.pet.server.ext.constants.BaseAttribute;
import com.pet.server.ext.data.Image;
import com.pet.server.ext.data.TimeLine;
import com.pet.server.ext.service.UserService;
import com.pet.server.ext.util.NumberUtil;
import com.pet.server.ext.util.Parameters;
import com.pet.server.ext.util.StringUtil;

public class Remove extends ActionBase{

	public Integer id;
	public Remove(){
		 needCheckAuth =true;
	}
	
	@Override
	public void initParameters(Parameters params) throws ApiError {	
		id=NumberUtil.getInteger(params.getFieldValue("id"));
		if(StringUtil.isEmpty(id)){
			throw ApiError.Type.INVALID_PARAM.toException();
		}
	}
	
	@Override
	public Result invokeService() throws ApiError {
		UserService userService = new UserService();
        userService.remoteTimeline(id, user.user_id);
		Result result = new Result();
	    return result;
	}
}
